home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp® 2.0.1 Tutorial / Chapter 14 / IconEdit.r next >
Encoding:
Text File  |  1990-10-25  |  5.5 KB  |  196 lines  |  [TEXT/MPS ]

  1. /*********************************************************************************/
  2. /* IconEdit.r                                                                     */
  3. /*                                                                                 */
  4. /* Copyright © 1989 Apple Computer, Inc.  All rights reserved.                       */
  5. /*                                                                                  */
  6. /*********************************************************************************/
  7.  
  8. /* ==============================   Includes   ================================= */
  9.  
  10. #ifndef _TYPES.R_
  11. #include "Types.r"
  12. #endif
  13.  
  14. #ifndef _MacAppTypes_
  15. #include "MacAppTypes.r"
  16. #endif
  17.  
  18. #ifndef __ViewTypes__
  19. #include "ViewTypes.r"
  20. #endif
  21.  
  22. #if qDebug
  23. include "Debug.rsrc";
  24. #endif
  25. include "MacApp.rsrc";
  26.  
  27. include "IconEdit" 'CODE';
  28.  
  29.  
  30. /* ==============================   Constants   ================================ */
  31.  
  32. #define cZoomIn                1000
  33. #define cZoomOut            1001
  34. #define cInvert                1002
  35. #define cDrawCommand        1003
  36.  
  37. #define kSeedIconId            1000
  38.  
  39. #define kIconWindowId        1000
  40.  
  41. #define kIconWindowId        1000
  42. #define kIconViewId            1001
  43.  
  44. #define kIconViewHeight        32 * 7 + 10     /* 7 times actual size, 5 pixel borders */
  45. #define kIconViewWidth        32 * 7 + 10     /* 7 times actual size, 5 pixel borders */
  46.  
  47. #define kIconWindowHeight    kIconViewHeight + kSBarSizeMinus1
  48. #define kIconWindowWidth    kIconViewWidth + kSBarSizeMinus1
  49.  
  50.  
  51.  
  52. /* ==============================   Seed Icon   ================================ */
  53.  
  54. resource 'ICON' (kSeedIconId, purgeable) {
  55.     $"0001 0000 0002 8000 0004 4000 0008 2000 0010 1000 0020 0800 0040 0400 0080 0200"
  56.     $"0100 0100 0200 0080 0400 0040 0800 0020 1000 0010 2000 0008 4000 3F04 8000 4082"
  57.     $"4000 8041 2001 3022 1001 C814 080E 7F8F 0402 3007 0201 0007 0100 8007 0080 6007"
  58.     $"0040 1FE7 0020 021F 0010 0407 0008 0800 0004 1000 0002 2000 0001 4000 0000 8000"
  59. };
  60.  
  61.  
  62.  
  63.  
  64. /* =============================   Icon Window   =============================== */
  65.  
  66. resource 'view' (kIconWindowId, purgeable) {
  67.     {
  68.         root, 'WIND', { 50, 20 }, { kIconWindowHeight, kIconWindowWidth },
  69.         sizeVariable, sizeVariable, shown, enabled,
  70.         Window        { "", zoomDocProc, goAwayBox, resizable, modeless,
  71.                           ignoreFirstClick, freeOnClosing, disposeOnFree, closesDocument,
  72.                           openWithDocument, dontAdaptToScreen, stagger, forceOnScreen,
  73.                           dontCenter, 'ICON', "" };
  74.                     
  75.         'WIND',  'SCLR',    { 0, 0 },
  76.         { kIconWindowHeight-kSBarSizeMinus1, kIconWindowWidth-kSBarSizeMinus1 },
  77.         sizeRelSuperView, sizeRelSuperView, shown, enabled,
  78.         Scroller    { "", vertScrollBar, horzScrollBar, 0, 0, 16, 16,
  79.                           vertConstrain, horzConstrain, { 0, 0, 0, 0 } };
  80.  
  81.         'SCLR', IncludeViews    { kIconViewId }
  82.     }
  83. };
  84.  
  85. resource 'view' (kIconViewId, purgeable) {
  86.     {
  87.         root, 'ICON', { 0, 0 }, { kIconViewHeight, kIconViewWidth },
  88.         sizeVariable, sizeVariable, shown, enabled,
  89.         View        { "TIconView"}
  90.     }
  91. };
  92.  
  93.  
  94. /* NOTE: if you used ViewEdit, then replace the above 'view' resources with:     */
  95. /* include "Views.rsrc" 'view';                                                  */
  96.  
  97.  
  98.  
  99.  
  100. /* ================================   Menus   ================================== */
  101.  
  102. resource 'cmnu' (mApple) {
  103.     1,
  104.     textMenuProc,
  105.     0x7FFFFFFD,
  106.     enabled,
  107.     apple,
  108.      {
  109.     /* [1] */    "About IconEdit…",    noIcon,    noKey,    noMark,    plain,    cAboutApp;
  110.     /* [2] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand
  111.     }
  112. };
  113.  
  114.  
  115. /* ------------------------------------------------------------------------------ */
  116.  
  117. resource 'cmnu' (mFile) {
  118.     2,
  119.     textMenuProc,
  120.     allEnabled,
  121.     enabled,
  122.     "File",
  123.      {
  124.     /* [1] */    "New",                noIcon,    "N",    noMark,    plain,    cNew;
  125.     /* [2] */    "Open…",            noIcon,    "O",    noMark,    plain,    cOpen;
  126.     /* [3] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  127.     /* [4] */    "Close",            noIcon,    noKey,    noMark,    plain,    cClose;
  128.     /* [5] */    "Save",                noIcon,    noKey,    noMark,    plain,    cSave;
  129.     /* [6] */    "Save As…",            noIcon,    noKey,    noMark,    plain,    cSaveAs;
  130.     /* [7] */    "Revert to Saved",    noIcon,    noKey,    noMark,    plain,    cRevert;
  131.     /* [8] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  132.     /* [9] */    "Page Setup…",        noIcon,    noKey,    noMark,    plain,    cPageSetup;
  133.     /* [10] */    "Print…",            noIcon,    noKey,    noMark,    plain,    cPrint;
  134.     /* [11] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  135.     /* [12] */    "Quit",                noIcon,    "Q",    noMark,    plain,    cQuit
  136.     }
  137. };
  138.  
  139.  
  140. /* ------------------------------------------------------------------------------ */
  141.  
  142. resource 'cmnu' (mEdit) {
  143.     3,
  144.     textMenuProc,
  145.     allEnabled,
  146.     enabled,
  147.     "Edit",
  148.      {
  149.     /* [1] */    "Undo",                noIcon,    "Z",    noMark,    plain,    cUndo;
  150.     /* [2] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  151.     /* [3] */    "Cut",                noIcon,    "X",    noMark,    plain,    cCut;
  152.     /* [4] */    "Copy",                noIcon,    "C",    noMark,    plain,    cCopy;
  153.     /* [5] */    "Paste",            noIcon,    "V",    noMark,    plain,    cPaste;
  154.     /* [6] */    "Clear",            noIcon,    noKey,    noMark,    plain,    cClear;
  155.     /* [7] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  156.     /* [8] */    "Show Clipboard",    noIcon,    noKey,    noMark,    plain,    cShowClipboard
  157.     }
  158. };
  159.  
  160.  
  161. /* ------------------------------------------------------------------------------ */
  162.  
  163. resource 'cmnu' (4) {
  164.     4,
  165.     textMenuProc,
  166.     allEnabled,
  167.     enabled,
  168.     "Icon",
  169.      {
  170.     /* [1] */    "Zoom In",             noIcon, "M",    noMark, plain,    cZoomIn;
  171.     /* [2] */    "Zoom Out",         noIcon, "L",     noMark, plain,    cZoomOut;
  172.     /* [3] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  173.     /* [4] */    "Invert",             noIcon, "I",     noMark, plain,    cInvert
  174.     }
  175. };
  176.  
  177.  
  178. /* ------------------------------------------------------------------------------ */
  179.  
  180. resource 'cmnu' (mBuzzWords) {
  181.     mBuzzWords,
  182.     textMenuProc,
  183.     allEnabled,
  184.     enabled,
  185.     "Buzzwords",
  186.      {
  187.     /* [1] */    "Page Setup Change", noIcon, noKey, noMark, plain, cChangePrinterStyle;
  188.     /* [2] */    "Drawing", noIcon, noKey, noMark, plain, cDrawCommand
  189.     }
  190. };
  191.  
  192.  
  193. /* ------------------------------------------------------------------------------ */
  194.  
  195. resource 'MBAR' (128) { {mApple; mFile; mEdit; 4} };
  196.